package config;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @BelongsProject: my-product
 * @BelongsPackage: config
 * @Author: wanglf
 * @CreateTime: 2023-06-20  11:29
 * @Description:
 * @Version: 1.0
 */
public class RedisDatabaseTypeCondition  implements Condition {


    public boolean matches(ConditionContext conditionContext,
                           AnnotatedTypeMetadata annotatedTypeMetadata) {
        String dbType = System.getProperty("dbType");
        return (dbType != null && dbType.equalsIgnoreCase("REDIS"));
    }
}